﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace ReportForm
{
    class TReportInput
    {
        UTLDB.UTLDB _cn = new UTLDB.UTLDB();
        DataTable dataDisPlay = new DataTable();
        public DataTable LoadProduct(string Date)
        {

            DataTable data = new DataTable();
            data = _cn.GetDataByStoredProcedure("sp_SelecttblProductByDate",
               new string[] { "@Date" },
               new object[] { Date }
                );
            return data;

        }
      /*  private void Load(DataTable data)
        {
             if (bool.Parse(data.Rows[0]["Change"].ToString()))
             {

                 txtPriceUnit.Text =utcommand.FormatMoney(data.Rows[0]["PriceUnit"].ToString().Trim(),"VND");
                
                 float price=float.Parse(data.Rows[0]["PriceUnit"].ToString().Trim()) * float.Parse(data.Rows[0]["Weight"].ToString());
                 txtPriceShell.Text = utcommand.FormatMoney(String.Format("{0:0.00}", price),"VND"); 
                
             }
             else {
                 txtPriceUnit.Enabled = false;
                 txtPriceUnit.Text = "<Giá cố định>";
                 txtPriceShell.Enabled = true;
                 txtPriceShell.Text = utcommand.FormatMoney(data.Rows[0]["Price"].ToString().Trim(), "VND");
             }

                 txtProduct.Text = data.Rows[0]["Name"].ToString().Trim();
                 txtWShell.Text = data.Rows[0]["Weight"].ToString().Trim();
                 txtMaterial.Text = data.Rows[0]["NameMaterial"].ToString().Trim();

                 //txtPriceShell.Text = data.Rows[0]["Price"].ToString();
                 txtWL.Text = data.Rows[0]["SizeL"].ToString().Trim();
                 txtPriceL.Text =utcommand.FormatMoney(data.Rows[0]["PriceL"].ToString().Trim(),"VND");
                 txtNumL.Text = data.Rows[0]["NumberSeedLarge"].ToString().Trim();

                 txtWM.Text = data.Rows[0]["SizeM"].ToString().Trim();
                 txtPriceM.Text =utcommand.FormatMoney(data.Rows[0]["PriceM"].ToString().Trim(),"VND");
                 txtNumM.Text = data.Rows[0]["NumberSeedSmall"].ToString();
                 float priceP = float.Parse(utcommand.FormatString(txtPriceShell.Text)) + float.Parse(utcommand.FormatString(txtPriceL.Text)) * int.Parse(txtNumL.Text) + float.Parse(utcommand.FormatString(txtPriceM.Text)) * int.Parse(txtNumM.Text);
                 txtPriceProduct.Text = utcommand.FormatMoney(String.Format("{0:0.00}", priceP),"VND");


         }
        }*/
    }
}